<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!-- 添加脚本内容 -->
    <script type="text/javascript">
        // 编写一个JavaScript对象
        var user = {
            name: "withered",
            age: 10,
            sex: "女"
        }

        // 将js对象转换为json对象
        var json = JSON.stringify(user);
        console.log(json);

        console.log("------------");

        // 将json对象转换为js对象
        var obj = JSON.parse(json);
        console.log(obj);

    </script>
</head>
<body>

</body>
</html>